package com.mazaiting.dtp.email;

import com.dtp.common.em.NotifyPlatformEnum;
import com.dtp.core.notify.AbstractDtpNotifier;
import com.dtp.core.notify.DtpNotifier;
import com.google.auto.service.AutoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;

/**
 * 自定义邮件通知
 **/
@Slf4j
@AutoService(DtpNotifier.class)
public class DtpEmailNotifier extends AbstractDtpNotifier {

    public DtpEmailNotifier(){
        super(new EmailNotifier());
    }

    @Override
    public String platform() {
        return NotifyPlatformEnum.EMAIL.name().toLowerCase();
    }

    @Override
    protected String getNoticeTemplate() {
        return DtpEmailConstant.EMAIL_CHANGE_NOTICE_TEMPLATE;
    }

    @Override
    protected String getAlarmTemplate() {
        return DtpEmailConstant.EMAIL_ALARM_TEMPLATE;
    }

    @Override
    protected Pair<String, String> getColors() {
        return new ImmutablePair<>(DtpEmailConstant.WARNING_COLOR, DtpEmailConstant.CONTENT_COLOR);
    }
}
